package com.dome.network;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

//TCP客户端
public class Client {
    public static void main(String[] args) throws IOException {
        //创建客户端Socket对象,传入服务端IP地址,和窗口
        //调用Socket方法写入要发送的信息
        //释放资源
        Socket socket=new Socket("192.168.81.219",7777);
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("Hello".getBytes());
        outputStream.flush();
        outputStream.close();
        socket.close();
    }
}
